<template>
	<view class="page">
		<pageTxt>
			<!--  v-model="dataList" @query="queryList" -->
			<z-paging ref="paging" :paging-style="{ 'background-color': '#f7f7f7', height: '100%', width: '100%' }">
				<!-- 头部 -->
				<template slot="top">
					<view class="navbar-box">
						<u-navbar :title="formData.project_id ? '完善项目' : '新增项目'" :autoBack="true" :fixed="false"></u-navbar>
					</view>
				</template>
				<view class="add-content ios">
					<u--form labelPosition="top" :model="formData" ref="uForm" labelWidth="auto">
						<view class="form-box">
							<u-form-item labelPosition="top" labelWidth="100%" required label="项目名称" prop="" borderBottom>
								<u--input
									placeholder="输入项目名称"
									inputAlign="left"
									v-model="formData.project_name"
									border="none"
									color="#000000"
									fontSize="28rpx"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="所属地区" prop="" borderBottom @click="cascaderFunc('cascaderShow')">
								<u--input
									placeholder="选择所属地区"
									inputAlign="left"
									v-model="formData.city_show"
									border="none"
									color="#000000"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="详细地址" prop="" borderBottom>
								<u--input
									placeholder="输入详细地址"
									inputAlign="left"
									v-model="formData.address"
									border="none"
									color="#000000"
									fontSize="28rpx"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="客户经理" prop="" borderBottom @click="cascaderFunc('accountManagerShow')">
								<u--input
									placeholder="选择客户经理"
									inputAlign="left"
									v-model="formData.account_manager_name"
									border="none"
									color="#000000"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="收款账户" prop="" @click="cascaderFunc('receivingAccountShow')">
								<u--input
									placeholder="选择收款账户"
									inputAlign="left"
									v-model="formData.receiving_account_show"
									border="none"
									color="#000000"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
						</view>
						<view class="form-box">
							<u-form-item labelPosition="top" labelWidth="100%" required label="关联客户" prop="" borderBottom @click="cascaderFunc('userShow')">
								<u--input
									placeholder="选择客户"
									inputAlign="left"
									v-model="formData.user_name"
									border="none"
									:color="formData.source == 3 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="品牌经理" prop="" borderBottom @click="cascaderFunc('channelManagerShow')">
								<u--input
									placeholder="选择品牌经理"
									inputAlign="left"
									v-model="formData.channel_manager_name"
									border="none"
									:color="formData.status >= 1102 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="品牌" prop="" borderBottom @click="cascaderFunc('brandShow')">
								<u--input
									placeholder="选择品牌"
									inputAlign="left"
									v-model="formData.brand_name"
									border="none"
									:color="formData.status >= 1102 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="客户需求品牌" prop="" borderBottom v-if="otherBrand">
								<u--input
									inputAlign="left"
									:value="otherBrand"
									border="none"
									color="#c8c9cc"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
								<view class="add-brand flex ac" @click="addBrandFunc">
									去添加品牌
									<u-icon name="arrow-right" color="#3d7fff" size="20rpx"></u-icon>
								</view>
							</u-form-item>

							<u-form-item
								labelPosition="top"
								labelWidth="100%"
								required
								label="装修类型"
								prop=""
								borderBottom
								@click="cascaderFunc('projectTypeShow')"
								v-if="formData.brand_id"
							>
								<u--input
									placeholder="选择装修类型"
									inputAlign="left"
									v-model="formData.store_type_name"
									border="none"
									:color="formData.status >= 1102 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="验收模板" prop="" borderBottom v-if="formData.store_type_name">
								<u--input
									placeholder="选择验收模板"
									inputAlign="left"
									v-model="formData.template_name"
									border="none"
									:color="formData.status >= 1102 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" required label="是否提前进场" prop="" borderBottom>
								<u-radio-group v-model="formData.construction_type" placement="row" :disabled="formData.status > 1010">
									<u-radio label="是" :name="2"></u-radio>
									<u-radio label="否" :name="1"></u-radio>
								</u-radio-group>
							</u-form-item>
							<u-form-item labelPosition="top" labelWidth="100%" label="约定勘场日期" prop="" borderBottom v-if="formData.survey_site != 1 && formData.survey_site">
								<u--input
									v-if="formData.status > 1025"
									placeholder="选择约定勘场日期"
									inputAlign="left"
									v-model="formData.survey_date"
									border="none"
									:color="formData.status > 1025 ? '#c8c9cc' : '#000000'"
									fontSize="28rpx"
									disabled
									disabledColor="#ffffff"
									suffixIcon="arrow-right"
									suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
									placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
								></u--input>
								<picker mode="date" :value="formData.survey_date" @change="confirmFunc" v-else>
									<u--input
										placeholder="选择约定勘场日期"
										inputAlign="left"
										v-model="formData.survey_date"
										border="none"
										:color="formData.status > 1025 ? '#c8c9cc' : '#000000'"
										fontSize="28rpx"
										disabled
										disabledColor="#ffffff"
										suffixIcon="arrow-right"
										suffixIconStyle="color: #727272;font-size:24rpx;font-weight:500;"
										placeholderStyle="font-weight: 400;font-size: 28rpx;color: #B1B1B0;"
									></u--input>
								</picker>
							</u-form-item>
						</view>
					</u--form>
				</view>
				<template #bottom>
					<u-button
						@click="submitFunc"
						text="提交"
						customStyle="width: 702rpx;height: 88rpx;background: #3B75FF;border-radius: 16rpx;font-weight: 500;font-size: 28rpx;color: #FFFFFF;margin:20rpx 24rpx;"
					></u-button>
				</template>
			</z-paging>
			<!-- 省市区选择 -->
			<city-cascader
				@closeFunc="closeFunc('cascaderShow')"
				:show="cascaderShow"
				:level="3"
				title="所属区域"
				:cityCurrVal="cityCurrVal"
				@confirm="confirmFunc($event, 'cascaderShow')"
			></city-cascader>
			<!-- 客户经理 -->
			<u-picker
				ref="accountManager"
				title="客户经理"
				closeOnClickOverlay
				:show="accountManagerShow"
				:columns="[accountManagerAdminList]"
				@confirm="confirmFunc($event, 'accountManagerShow')"
				@cancel="closeFunc('accountManagerShow')"
				@close="closeFunc('accountManagerShow')"
				keyName="name"
			></u-picker>
			<!-- 收款账户 -->
			<u-picker
				ref="receivingAccount"
				title="收款账户"
				closeOnClickOverlay
				:show="receivingAccountShow"
				:columns="[receivingAccountList]"
				@confirm="confirmFunc($event, 'receivingAccountShow')"
				@cancel="closeFunc('receivingAccountShow')"
				@close="closeFunc('receivingAccountShow')"
				keyName="account_name"
			></u-picker>
			<!-- 客户列表 -->
			<lzcPicker
				ref="userPicker"
				@confirm="confirmFunc($event, 'userShow')"
				:pickerList="userList"
				:defaultValue="formData.user_id"
				placeholder="输入客户名称搜索"
				pickerTittle="客户列表"
			/>
			<!-- 品牌列表 -->
			<u-picker
				ref="brand"
				closeOnClickOverlay
				:show="brandShow"
				:columns="[brandList]"
				@confirm="confirmFunc($event, 'brandShow')"
				@cancel="closeFunc('brandShow')"
				@close="closeFunc('brandShow')"
				keyName="name"
				title="品牌列表"
			></u-picker>
			<!-- 装修类型列表 -->
			<u-picker
				ref="projectType"
				closeOnClickOverlay
				:show="projectTypeShow"
				:columns="[projectTypeList]"
				@confirm="confirmFunc($event, 'projectTypeShow')"
				@cancel="closeFunc('projectTypeShow')"
				@close="closeFunc('projectTypeShow')"
				keyName="label"
				title="装修类型列表"
			></u-picker>
			<!-- 品牌经理列表 -->
			<u-picker
				ref="channelManager"
				closeOnClickOverlay
				:show="channelManagerShow"
				:columns="[channelManagerList]"
				@confirm="confirmFunc($event, 'channelManagerShow')"
				@cancel="closeFunc('channelManagerShow')"
				@close="closeFunc('channelManagerShow')"
				keyName="name"
				title="品牌经理列表"
			></u-picker>
		</pageTxt>
	</view>
</template>

<script>
import lzcPicker from '../../components/lzc-picker/lzc-picker.vue';
export default {
	components: {
		lzcPicker
	},
	data() {
		return {
			cascaderShow: false,
			formData: {
				source: '',
				status: '',
				project_name: '',
				store_type_id: '',
				store_type_name: '',
				city_show: '',
				province_id: '',
				city_id: '',
				county_id: '',
				address: '',
				user_id: '',
				user_name: '',
				brand_id: '',
				brand_name: '',
				template_id: '',
				template_name: '',
				channel_manager_id: '',
				channel_manager_name: '',
				account_manager_id: '',
				account_manager_name: '',
				receiving_account_id: '',
				receiving_account_show: '',
				construction_type: 1,
				remark: '',
				survey_date: ''
			},
			cityCurrVal: [],
			accountManagerAdminList: [], //客户经理列表
			accountManagerShow: false, //客户经理弹窗
			receivingAccountList: [], //收款账户列表
			receivingAccountShow: false, //收款列表弹窗
			userList: [], //客户列表
			userShow: false, //客户列表弹窗
			brandList: [], //品牌列表
			brandShow: false, //品牌列表弹窗
			projectTypeList: [], //装修类型列表
			projectTypeShow: false, //装修类型弹窗
			channelManagerList: [], //品牌经理列表
			channelManagerShow: false, //品牌经理弹窗
			otherBrand: '' //其他品牌  用户预设
		};
	},
	onLoad(option) {
		if (option.id) {
			this.getProjectDetails(option.id);
		}
		this.accountManagerAdminListFunc();
		this.getCompanyList();
		this.getUserList();
		this.getBrandList();
		this.getChannel_managerList();
	},
	methods: {
		// 添加品牌提示
		addBrandFunc() {
			uni.showModal({
				title: '提示',
				content: '请到PC后台进行品牌添加',
				showCancel: false
			});
		},
		// 项目详情
		getProjectDetails(project_id) {
			this.$Apipc
				.getProjectDetails({
					project_id
				})
				.then((res) => {
					console.log(res, '项目详情');
					if (res.code == 200) {
						let data = res.data;
						if (data.brand_id === 0) {
							this.otherBrand = data.brand_name;
						}
						this.cityCurrVal = [data.province_id, data.city_id, data.county_id];
						this.formData = {
							source: data.source,
							status: data.status,
							project_id,
							project_name: data.project_name,
							store_type_id: data.store_type_id,
							store_type_name: data.store_type_name ? data.store_type_name + '(' + data.template_name + ')' : '',
							city_show: data.area,
							province_id: data.province_id,
							city_id: data.city_id,
							county_id: data.county_id,
							address: data.address,
							user_id: data.user_id,
							user_name: data.customer_name,
							brand_id: data.brand_id,
							brand_name: data.brand_id ? data.brand_name : '',
							template_id: data.template_id,
							template_name: data.template_name,
							channel_manager_id: data.channel_manager_id,
							channel_manager_name: data.channel_manager_name,
							account_manager_id: data.account_manager_id,
							account_manager_name: data.account_manager_name,
							receiving_account_id: data.receiving_account.id,
							receiving_account_show: data.receiving_account.account_name,
							construction_type: data.construction_type,
							remark: '',
							survey_date: data.survey_date || '',
							survey_site: data.survey_site ? data.survey_site : 1
						};
					}
				});
		},
		// picker 弹窗打开
		cascaderFunc(type) {
			switch (type) {
				// 省市区
				case 'cascaderShow':
					this.cascaderShow = true;
					break;
				// 客户经理
				case 'accountManagerShow':
					let accountManagerIndex = this.accountManagerAdminList.findIndex((item) => {
						return item.id == this.formData.account_manager_id;
					});
					this.$refs.accountManager.setIndexs([accountManagerIndex == -1 ? 0 : accountManagerIndex], true);
					this.accountManagerShow = true;
					break;
				// 账户
				case 'receivingAccountShow':
					let receivingAccountIndex = this.receivingAccountList.findIndex((item) => {
						return item.id == this.formData.receiving_account_id;
					});
					this.$refs.receivingAccount.setIndexs([receivingAccountIndex == -1 ? 0 : receivingAccountIndex], true);
					this.receivingAccountShow = true;
					break;
				// 客户
				case 'userShow':
					if (this.formData.source == 3) return;
					this.userShow = true;
					this.$refs.userPicker.handleShow();
					break;
				// 品牌
				case 'brandShow':
					if (this.formData.status >= 1102) return;
					let brandIndex = this.brandList.findIndex((item) => {
						return item.id == this.formData.brand_id;
					});
					this.$refs.brand.setIndexs([brandIndex == -1 ? 0 : brandIndex], true);
					this.brandShow = true;
					break;
				// 项目类型
				case 'projectTypeShow':
					if (this.formData.status >= 1102) return;
					if (!this.formData.brand_id) {
						uni.showToast({
							title: '请先选择品牌',
							icon: 'error'
						});
						return;
					}

					let i = this.brandList.findIndex((item) => {
						return item.id == this.formData.brand_id;
					});
					this.projectTypeList = this.brandList[i].store_list;

					if (!this.projectTypeList.length) {
						uni.showToast({
							title: '当前品牌无装修类型',
							icon: 'error'
						});
						return;
					}
					let projectTypeIndex = this.projectTypeList.findIndex((item) => {
						return item.value == this.formData.store_type_id + '' + this.formData.template_id;
					});
					this.$nextTick(() => {
						this.$refs.projectType.setIndexs([projectTypeIndex == -1 ? 0 : projectTypeIndex], true);
					});
					this.projectTypeShow = true;
					break;
				// 品牌经理
				case 'channelManagerShow':
					let channelManagerIndex = this.channelManagerList.findIndex((item) => {
						return item.id == this.formData.channel_manager_id;
					});
					this.$refs.channelManager.setIndexs([channelManagerIndex == -1 ? 0 : channelManagerIndex], true);
					this.channelManagerShow = true;
					break;
				default:
			}
		},
		// picker 弹窗关闭
		closeFunc(type) {
			switch (type) {
				case 'cascaderShow':
					this.cascaderShow = false;
					break;
				case 'accountManagerShow':
					this.accountManagerShow = false;
					break;
				case 'receivingAccountShow':
					this.receivingAccountShow = false;
					break;
				case 'userShow':
					this.userShow = false;
					this.$refs.userPicker.handleHide();
					break;
				case 'brandShow':
					this.brandShow = false;
					break;
				case 'projectTypeShow':
					this.projectTypeShow = false;
					break;
				case 'channelManagerShow':
					this.channelManagerShow = false;
					break;
				default:
			}
		},
		// picker 弹窗选择
		confirmFunc(e, type) {
			console.log(e);
			switch (type) {
				case 'cascaderShow':
					this.formData.city_show = e.value[0].name + e.value[1].name + e.value[2].name;
					this.formData.province_id = e.value[0].id;
					this.formData.city_id = e.value[1].id;
					this.formData.county_id = e.value[2].id;
					this.cityCurrVal = [e.value[0].id, e.value[1].id, e.value[2].id];
					this.cascaderShow = false;
					break;
				case 'accountManagerShow':
					this.formData.account_manager_id = e.value[0].id;
					this.formData.account_manager_name = e.value[0].name;
					this.accountManagerShow = false;
					break;
				case 'receivingAccountShow':
					this.formData.receiving_account_show = e.value[0].account_name;
					this.formData.receiving_account_id = e.value[0].id;
					this.receivingAccountShow = false;
					break;
				case 'userShow':
					this.userShow = false;
					this.formData.user_name = e ? e.name : '';
					this.formData.user_id = e ? e.id : '';
					break;
				case 'brandShow':
					this.brandShow = false;
					this.formData.brand_name = e.value[0].name;
					this.formData.brand_id = e.value[0].id;
					this.projectTypeList = e.value[0].store_list;
					break;
				case 'projectTypeShow':
					this.projectTypeShow = false;
					this.formData.store_type_id = e.value[0].store_type_id;
					this.formData.store_type_name = e.value[0].label;
					this.formData.template_id = e.value[0].template_id;
					this.formData.template_name = e.value[0].template_name;
					break;
				case 'channelManagerShow':
					this.channelManagerShow = false;
					this.formData.channel_manager_name = e.value[0].name;
					this.formData.channel_manager_id = e.value[0].id;
					break;
				default: //约定勘场日期
					this.formData.survey_date = e.detail.value;
			}
		},
		// 字段判空
		isNullFunc() {
			let formData = this.formData;
			if (!formData.project_name) {
				uni.showToast({
					title: '请输入项目名称',
					icon: 'error'
				});
				return false;
			}
			if (!formData.province_id) {
				uni.showToast({
					title: '请选择所属地区',
					icon: 'error'
				});
				return false;
			}
			if (!formData.address) {
				uni.showToast({
					title: '请输入详细地址',
					icon: 'error'
				});
				return false;
			}
			if (!formData.account_manager_id) {
				uni.showToast({
					title: '请选择客户经理',
					icon: 'error'
				});
				return false;
			}
			if (!formData.user_id) {
				uni.showToast({
					title: '请选择客户',
					icon: 'error'
				});
				return false;
			}
			if (!formData.channel_manager_id) {
				uni.showToast({
					title: '请选择品牌经理',
					icon: 'error'
				});
				return false;
			}
			if (!formData.brand_id) {
				uni.showToast({
					title: '请选择品牌',
					icon: 'error'
				});
				return false;
			}
			if (!formData.store_type_name) {
				uni.showToast({
					title: '请选择装修类型',
					icon: 'error'
				});
				return false;
			}
			if (!formData.template_id) {
				uni.showToast({
					title: '请选择验收模板',
					icon: 'error'
				});
				return false;
			}
			return true;
		},
		// 添加项目
		submitFunc() {
			let formData = this.formData;
			console.log(formData);
			if (!this.isNullFunc()) return;
			if (formData.project_id) {
				// 修改
				this.updProject(formData);
				return;
			}
			// 新增
			this.addProject(formData);
		},
		updProject(formData) {
			uni.showLoading({
				mask: true
			});
			this.$Apipc.updProject(formData).then((res) => {
				console.log(res, '修改项目');
				uni.hideLoading();
				if (res.code == 200) {
					uni.showToast({
						title: res.message,
						icon: 'success'
					});

					setTimeout(() => {
						var currentPages = getCurrentPages()[getCurrentPages().length - 2];
						if (currentPages) {
							uni.navigateBack({
								delta: 1
							});
						} else {
							uni.reLaunch({
								url: '/pages/index/index'
							});
						}
					}, 500);
				} else {
					uni.showToast({
						title: res.message,
						icon: 'error'
					});
				}
			});
		},
		addProject(formData) {
			uni.showLoading({
				mask: true
			});
			this.$Apipc.addProject(formData).then((res) => {
				console.log(res, '添加项目');
				uni.hideLoading();
				if (res.code == 200) {
					uni.showToast({
						title: res.message,
						icon: 'success'
					});
					var pages = getCurrentPages();
					var perPage = pages[pages.length - 2];
					if (perPage.$vm.$refs.projectManagement) {
						perPage.$vm.$refs.projectManagement.searchFunc();
					}

					setTimeout(() => {
						var currentPages = getCurrentPages()[getCurrentPages().length - 2];
						if (currentPages) {
							uni.navigateBack({
								delta: 1
							});
						} else {
							uni.reLaunch({
								url: '/pages/index/index'
							});
						}
					}, 500);
				} else {
					uni.showToast({
						title: res.message,
						icon: 'error'
					});
				}
			});
		},
		// 客户经理列表
		accountManagerAdminListFunc() {
			this.$Apipc
				.getAdminList({
					page: 1,
					num: 999,
					identity: 1,
					position_id_arr: [2]
				})
				.then((res) => {
					console.log(res, '客户经理列表');
					if (res.code == 200) {
						this.accountManagerAdminList = res.data.list;
					}
				});
		},
		// 收款账户列表
		getCompanyList() {
			this.$Apipc
				.getCompanyList({
					page: 1,
					num: 999,
					account_type: 1
				})
				.then((res) => {
					console.log(res, '收款账户列表');
					if (res.code == 200) {
						this.receivingAccountList = res.data.list;
					}
				})
				.catch((err) => {});
		},
		// 客户列表
		getUserList() {
			var obj = {
				page: 1,
				num: 9999,
				keyword: '',
				province_id: '',
				city_id: '',
				county_id: '',
				identity: 4,
				position_id_arr: []
			};
			this.$Apipc
				.getUserList(obj)
				.then((res) => {
					console.log(res, '客户列表');
					if (res.code == 200) {
						this.userList = res.data.list;
					}
				})
				.catch((err) => {});
		},
		// 品牌列表
		getBrandList() {
			this.$Apipc
				.getBrandList({
					page: 1,
					num: 9999,
					keyword: ''
				})
				.then((res) => {
					console.log(res, '品牌列表');
					if (res.code == 200) {
						res.data.list.forEach((item) => {
							item.store_list.forEach((child) => {
								child.value = Number(child.store_type_id + '' + child.template_id);
								child.label = child.store_type_name + '(' + child.template_name + ')';
							});
						});
						this.brandList = res.data.list;
					}
				})
				.catch(() => {});
		},
		// 品牌经理列表
		getChannel_managerList() {
			var obj = {
				page: 1,
				num: 9999,
				keyword: '',
				province_id: '',
				city_id: '',
				county_id: '',
				identity: 3,
				position_id_arr: []
			};
			this.$Apipc
				.getAdminList(obj)
				.then((res) => {
					console.log(res, '品牌经理列表');
					if (res.code == 200) {
						this.channelManagerList = res.data.list;
					}
				})
				.catch((err) => {});
		}
	}
};
</script>

<style lang="scss" scoped>
@import 'addProject.scss';
</style>
